/**
 * huize Service Inc
 * All Rights Reserved @2018
 */
package com.huize.ladon.apm.common.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * 描述: TraceId实体
 *
 * @author tianyuliang
 * @version $Id: TraceIdWrapper.java, v0.1 2019/3/28
 */
@Data
public class TraceIdWrapper implements Serializable {

    private static final long serialVersionUID = 7090760580791136101L;

    /**
     * IPV4地址
     */
    private String ip;

    /**
     * PID进程号
     */
    private Integer pid;

    /**
     * 时间戳,毫秒
     */
    private Long timestamp;

    /**
     * 序列号，从1000-9999循环
     */
    private Integer sequence;

    public TraceIdWrapper() {

    }

    public TraceIdWrapper(String ip, Integer pid, Long timestamp, Integer sequence) {
        this.ip = ip;
        this.pid = pid;
        this.timestamp = timestamp;
        this.sequence = sequence;
    }

    @Override
    public String toString() {
        String formatter = "TraceIdWrapper{ip=%s, pid=%d, timestamp=%d, sequence=%d}";
        return String.format(formatter, ip, pid, timestamp, sequence);
    }

}
